package com.aaa.service.scl.impl;

import com.aaa.dao.scl.SclDao;
import com.aaa.entity.system.PageEnty;
import com.aaa.entity.scl.Scl;

import com.aaa.service.scl.SclService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 问题表(Scl)表服务实现类
 *
 * @author makejava
 * @since 2022-08-30 14:34:47
 */
@Service("sclService")
public class SclServiceImpl  implements SclService{
    @Autowired
    private SclDao sclDao;

    /**
     * @create by: Teacher马
     * @description:  分页排序 功能
     * @create time:

     * @return
     */
    @Override
    public List<Scl> queryAllUserPage(PageEnty pageEnty, Scl scl) {
        PageHelper.startPage(pageEnty.getPage(),pageEnty.getLimit(),pageEnty.orderBy());
        List<Scl> scls = sclDao.queryAllUserPage(scl);

        return scls;
    }

    @Override
    public boolean saveUser(Scl scl) {
     return  sclDao.saveUser(scl);
    }

    @Override
    public boolean deleteUser(int[] id) {
        return sclDao.deleteUser(id);
    }

    @Override
    public boolean updateUser(Scl scl) {
        return sclDao.updateUser(scl);
    }

    @Override
    public boolean repetitionName(Scl scl) {
        Integer repetitionName = sclDao.repetitionName(scl);
        if (repetitionName==0){
            return true;
        }
        return false;
    }
}
